<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>申请成为经纪人</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <link rel="stylesheet" href="../css/mui.min.css">
    <script src="../uploader/js/jquery.js"></script>
    <script src="../uploader/js/upload.js"></script>
    <link rel="stylesheet" href="../js/loding/loding.css">
    <!--引入JS-->
    <style>
        li{
            list-style-type:none;
            width:150px;
        }
        input{
            width: 75%!important;
        }
        label{
            width: 23%!important;
        }
        label span{

            display:inline-block;
            vertical-align:middle;

        }
    </style>
</head>
<body>
<div class="mui-content" >
    <div class="headage"></div>
    <div class="mui-content-padded" style="height: 121px!important;">
        <img src="../images/top3.jpg" style="width:100%;text-align: center;height: 120px;"/>
    </div>

    <div class="container">
        <form class="mui-input-group" style="height: 410px;">
            <div class="mui-input-row ">
                <label>姓名:<span style="color: crimson;margin-top: 10px;">*</span></label>
                <input type="text" class=" mui-input-clear" placeholder="" id="username">
            </div>
            <div class="mui-input-row ">
                <label>电话:<span style="color: crimson;margin-top: 10px;">*</span></label>
                <input type="text" class=" mui-input-clear" placeholder="" id="phone">
            </div>
            <div class="mui-input-row ">
                <label style="width: 25%!important;">身份证:<span style="color: crimson;margin-top: 10px;">*</span></label>
                <input type="text" class=" mui-input-clear" placeholder="" id="sfz">
            </div>
            <div class="mui-input-row ">
                <label>位置:<span style="color: crimson;margin-top: 10px;">*</span></label>
                <input type="text" class=" mui-input-clear" placeholder="" id="address">
            </div>
            <ul style="width: 100%;height: 160px;">
                <li style="float: left;width: 50%">
                    <p style="text-align: center;"><label>正面照</label><label style="color: crimson;">*</label></p>
                    <div id="drop_area0"></div>
                </li>
                <li style="float: left;width: 48%">
                    <p style="text-align: center;"><label></label>示例图<label style="color: crimson;">*</label></p>
                    <div>
                        <img src="../images/sc.jpg" width="150px" height="150px">
                    </div>
                </li>
            </ul>
            <label style="color: #8f8f94; font-size: 9px;text-align: center;width: 100%!important;float: left;">温馨提示：请按<a  href="javascript:void(0);">示例图</a>标准手持身份证拍照</label>
        </form>

    </div>
    <div style="width: 100%;display: none" id="bt">
        <button type="button" class="mui-btn mui-btn-primary" id="save"  style="width: 80%;height: 35px;float: left;margin-left: 10%;margin-top: 20px;">提交资料</button>
    </div>
</div>
</body>
<script src="../js/mui.min.js"></script>
<script src="../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/cookieutil.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/getUrlParam.js"></script>
<script src="../uploader/js/uploaderutils.js"></script>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
<script src="../js/payutils.js"></script>
<script src="../js/loding/loading.js"></script>
<script>
    $(".headage").load("head.html");
    $(function(){
        /*公共部分
         * 导航栏
         * footer CopyRight
         */
        imglist="";
        var dragImgUpload0 = new DragImgUpload("#drop_area0",{
            callback:function (files) {
                //回调函数，可以传递给后台等等
                var file = files;
                console.log(file.name);
                saveimg(file,"正面照",0);
                showLoading("正在上传请稍等..","div");
                setTimeout(function(){
                    hideLoading();//隐藏后的回调函数
                    $("#bt").attr("style","display:block;");
                }, 1000);
            }
        })


        $("#save").click(function () {
            var phone = $("#phone").val();
            var address = $("#address").val();
            var username = $("#username").val();
            var sfz = $("#sfz").val();
            if (phone == "" || phone == undefined) {
                mui.toast('请输入你的联系电话！');
                return;
            } else {
                var t = Isphone(phone);
                if (t == false) {
                    mui.toast('联系电话格式不对！');
                    return;
                }
            }
            if (address == "" || address == undefined) {
                mui.toast('请输入你的联系地址！');
                return;
            }
            if (username == "" || username == undefined) {
                hideLoading();//隐藏后的回调函数
                mui.toast('请输入你的姓名！');
                return;
            }
            if (sfz == "" || sfz == undefined) {
                hideLoading();//隐藏后的回调函数
                mui.toast('请输入你的身份证！');
                return;
            }
            if (imglist == "" || imglist == null || imglist == undefined) {
                mui.toast('请按要求上传 图片！');
                return;
            }
            var  userid=getCookie('userid');
            mui.post('/Order/inserAgent',
                {
                    userid:userid,
                    Mobile:phone,
                    Address:address,
                    Username:username,
                    preimages:imglist,
                    hetongmoney:5000,
                    sfz:sfz
                },
                function(data){
                    console.log(data);
                    if (data.code){
                        mui.toast('资料提交成功！');
                        getwxkey(data.object);
                        //window.history.back(-1);

                    }
                },'json'
            )
        })
    });
</script>

</html>